import request from '@/utils/request'
import qs from 'qs'
// 查询物品分类信息列表
export function listCategory(query) {
  return request({
    url: '/group/category/list',
    method: 'get',
    params: query
  })
}
// 查询物品分类信息列表
export function listChildren(query) {
  return request({
    url: '/group/category/listChildren',
    method: 'get',
    params: query
  })
}
// 查询物品分类信息详细
export function getCategory(id) {
  return request({
    url: '/group/category/' + id,
    method: 'get'
  })
}

// 新增物品分类信息
export function addCategory(data) {
  return request({
    url: '/group/category',
    method: 'post',
    data: data
  })
}

// 修改物品分类信息
export function updateCategory(data) {
  return request({
    url: '/group/category',
    method: 'put',
    data: data
  })
}

// 删除物品分类信息
export function delCategory(busiPath) {
  return request({
    url: '/group/category/' + busiPath,
    method: 'delete'
  })
}

export function reapply(params) {
  let formParams = qs.stringify(params, {indices: false});
  return request({
    url: '/group/category/transfer',
    data: formParams,
    headers: {'content-type': 'application/x-www-form-urlencoded'}, // 表单参数
    method: 'post'
  })
}
